def solve():
  
  n = int(input())
  #a = list(map(int, input().split()))  #
  a = list(map(int,input().split(" ")))
  R=0
  for i  in range(n):
    if a[i]<=R+1:
      R+=a[i]
    else:
      print(f"{R+1}")
      return
  print(f"{R+1}")


T = int(input())
for _ in range(T):
  solve()